home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 30 / PC Gamer IT CD 30 1-2.iso / MOTS / GAMEDATA / RESOURCE / JKMRES.GOO / cog_pow_goggles.cog < prev    next >
Text File  |  1998-02-25  |  2KB  |  81 lines

  1. # Jedi Knight Cog Script
  2. #
  3. # POW_GOGGLES.COG
  4. #
  5. # POWERUP Script - IR Goggles
  6. #
  7. # [YB & CYW]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10.  
  11.  
  12. symbols
  13.  
  14. thing       powerup                          local
  15. thing       player                           local
  16. int         bin=41                           local
  17. sound       pickupsnd=BactaPu1.wav           local
  18. sound       respawnsnd=Activate01.wav        local
  19. flex        amount                           local
  20.  
  21. message     touched
  22. message     taken
  23. message     respawn
  24.  
  25. end
  26.  
  27. # ========================================================================================
  28.  
  29. code
  30. touched:
  31.    player = GetSourceRef();
  32.    amount = GetInv(player, bin);
  33.  
  34.    if((amount < GetInvMax(player, bin)) || (GetInv(player, 13) < GetInvMax(player, 13)))
  35.    {
  36.       TakeItem(GetSenderRef(), -1);
  37.       call taken;
  38.    }
  39.  
  40.    Return;
  41.  
  42. # ........................................................................................
  43.  
  44. taken:
  45.    player = GetSourceRef();
  46.    powerup = GetSenderRef();
  47.  
  48.    // Do effects.
  49.    PlaySoundLocal(pickupsnd, 1, 0, 0);
  50.    AddDynamicTint(player, 0.0, 0.0, 0.2);
  51.  
  52.    if(amount < GetInvMax(player, bin))
  53.    {
  54.       // Print("IR Goggles");
  55.       jkPrintUNIString(player, bin);
  56.  
  57.       // Increment powerup amount.
  58.       ChangeInv(player, bin, 1.0);
  59.       SetInvAvailable(player, bin, 1);
  60.    }
  61.    else
  62.    {
  63.       // Print("Battery");
  64.       jkPrintUNIString(player, 13);
  65.       ChangeInv(player, 13, 25.0);
  66.       SetInvAvailable(player, 13, 1);
  67.    }
  68.  
  69.    Return;
  70.  
  71. # ........................................................................................
  72.  
  73. respawn:
  74.    PlaySoundThingLocal(respawnsnd, GetSenderRef(), 0.6, 5.0, 10.0, 0);
  75.  
  76.    Return;
  77.  
  78. end
  79.  
  80.  
  81.